// UART write and read

#include "../../ACUAS/ACUAS.h"
#include "../../ACUAS/ACUASUART.h"

#define UART_BAUD_RATE 1200			// set baud rate

PROGRAM_INIT
	char c;
	INIT_UART						// initialize the UART
									// send a string to UART
	UART_TEXT("ACUAS Easy Programming. Send text!") UART_CHAR(13) UART_CHAR(13)

PROGRAM_START
	UART_READ_CHAR(c)				// read one character from UART buffer
	if(c)							// if a character was read from buffer:
		{
		LED_ON(1) 
		UART_CHAR('(') 				// send "(character)" back to UART
		UART_CHAR(c) 
		UART_CHAR(')')
		} 
	else 
		LED_OFF(1)
PROGRAM_END

